package com.juzipi.demo.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.juzipi.demo.mapper.TokenMapper;
import com.juzipi.demo.pojo.Token;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TokenService {


    @Autowired
    private TokenMapper tokenMapper;


    public void createToken(Token token) {
        tokenMapper.insert(token);

    }

    public Token queryToken(String token) {

        return tokenMapper.selectOne(new QueryWrapper<Token>().lambda().eq(Token::getToken,token));

    }
}
